package com.qf.controller;

import com.qf.entity.TbBrand;
import com.qf.service.TbBrandService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (TbBrand)表控制层
 *
 * @author makejava
 * @since 2021-04-06 09:44:31
 */
@RestController
@RequestMapping("tbBrand")
public class TbBrandController {
    /**
     * 服务对象
     */
    @Resource
    private TbBrandService tbBrandService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public TbBrand selectOne(Integer id) {
        return this.tbBrandService.queryById(id);
    }

    @GetMapping("/selectAll")
    public List<TbBrand> selectAll(TbBrand tbBrand){
        return tbBrandService.queryAll(tbBrand);
    }

    @GetMapping("/selectByCategoryId")
    public List<TbBrand> selectByCategoryId(Integer CategoryId){
//        System.out.println(CategoryId);
        return tbBrandService.queryByCategoryId(CategoryId);
    }
}